﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Simple.ISysService;
using Simple.SysService;
using Simple.Tools;
using SimpleSaas.Common;
using SimpleSaas.Entity.Dto;
using SimpleSaas.Web.Common;

namespace SimpleSaasUser.Controllers
{
	[Route("api/sys-user")]
	[ApiController]
	public class SysUserController : BaseController
	{
		[Autowired]
		protected ISysUserService sysUserService { get; set; }

		/// <summary>
		/// 
		/// </summary>
		/// <param name="loginUserDto"></param>
		/// <returns></returns>
		[HttpPost("login")]
		public async Task<SimpleSaas.Common.BaseMessage> LoginAsync([FromBody] LoginUserDto loginUserDto)
		{
			return Ok(await sysUserService.LoginAsync(loginUserDto));
		}
	}
}